<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/pintuer.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/admin.css">
<script src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script src="${pageContext.request.contextPath}/js/pintuer.js"></script>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/toastr.css">
<script src="${pageContext.request.contextPath}/js/toastr.min.js"></script>
</head>
<body>
	<script type="text/javascript">
		function addBorrowTime(bookId) {
			if (confirm("确定续借该书籍一个月吗?")) {
				$.ajax({
							type : "POST",
							url : "${pageContext.request.contextPath}/reader/addBorrowTime",
							data : {
								"bookId" : bookId
							},
							success : function(data) {
								if (data.result == "续借成功") {
									toastr.options.positionClass = 'toast-center-center'
									toastr.success("归还成功,刷新页面生效");
								} else {
									toastr.options.positionClass = 'toast-center-center'
									toastr.error("unknow erro!");
								}
							}
						});
				return false;
			}
		}
	</script>
	<form method="post" action="" id="listform">
		<div class="panel admin-panel">
			<div class="panel-head">
				<strong class="icon-reorder"> 借阅信息列表</strong> <a href=""
					style="float: right; display: none;">添加字段</a>
			</div>
			<table class="table table-hover text-center">
				<tr class="trHeader">
					<th width="200">书号</th>
					<th width="200">书籍名称</th>
					<th width="200">归还日期</th>
					<th width="200">续借状态</th>
					<th width="200">操作</th>
				</tr>
				<c:forEach items="${list.returnData}" var="msg">
				    <tr>
					<td id="td"><c:out value="${msg.bookId}"></c:out></td>
					<td><c:out value="${msg.bookName}"></c:out></td>
					<td><f:formatDate value="${msg.returnDate}"
							pattern="yyyy年MM月dd日" /></td>
					<td><c:if test="${msg.addTag==1}"> 可以续借</c:if> <c:if
							test="${msg.addTag==0}"> 不可以续借</c:if></td>

					<td><c:if test="${msg.addTag==1}">
							<div class="button-group">
								<a style="margin-left: 15px;" class="button border-red" href="#"
									onclick="addBorrowTime('${msg.bookId}')"><span
									class="icon-trash-o"></span> 续借</a>
						</c:if> 
						<c:if test="${msg.addTag==0}">--</c:if></td>
                    </tr>
				</c:forEach>








			</table>
		</div>
	</form>

</body>
</html>